/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package technotheist.data.grid;

import java.util.EnumMap;
import technotheist.data.BufferManager;
import technotheist.data.wrap.BMatrix2D;

/**
 *
 * @author Mitch
 */
public class Layer<T> {
    public final Volume<T> parent;
    public final EnumMap<BorderType, BorderLine<T>> borders;
    public final BMatrix2D<T> layer;
    public final int layerId;

    public Layer(BufferManager mngr, Volume<T> parent, int layerId) {
	this.parent = parent;
	this.borders = new EnumMap<>(BorderType.class);
	this.layer = parent.volume.createCrossSectionYZ(mngr, layerId);
	this.layerId = layerId;
	borders.put(BorderType.Left, parent.borders.get(BorderType.Left).createChild(layerId));
	borders.put(BorderType.Right, parent.borders.get(BorderType.Right).createChild(layerId));
	borders.put(BorderType.Front, parent.borders.get(BorderType.Front).createChild(layerId));
	borders.put(BorderType.Back, parent.borders.get(BorderType.Back).createChild(layerId));
    }
    
}
